<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="text">
</body>
<script>
    const inp = document.querySelector("input");
    inp.onchange = function(){
        console.log(1111,this.value);
    }
    inp.oninput = function(){
        console.log(2,this.value);
    }
</script>
</html>